<template>
    <div>
        <h1>入党请人公示</h1>
        <ul>
            <li v-for="stu in appliers">{{  stu.name }}</li>
        </ul>
    </div>
</template>

<script>
import { ref, computed } from "vue"
export default {
    name: 'Publicity',
    components: {
    },
    setup() {
        const students = [
            { name: "张三", isApply: true,is18: true },
            { name: "李四", isApply: true,is18: true },
            { name: "王五", isApply: true,is18: true },
            { name: "钱六", isApply: true,is18: true },
            { name: "张三5", isApply: false,is18: true },
            { name: "张三6", isApply: true,is18: false },
            { name: "张三7", isApply: true,is18: true },
            { name: "张三8", isApply: true,is18: true },
            { name: "张三9", isApply: true,is18: true },
            { name: "张三10", isApply: true,is18: true },
        ]
        const appliers = computed(() => {
            console.log("计算机属性触发")
            return students.filter(stu => stu.isApply & stu.is18)
        })

        return {
            students,
            appliers
        }
    }
}
</script>